.class public Lrexsee/dialog/ImageMultiTouchListener;
.super Ljava/lang/Object;
.source "ImageMultiTouchListener.java"

# interfaces
.implements Landroid/view/View$OnTouchListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;
    }
.end annotation


# static fields
.field private static final MODE_DRAG:I = 0x1

.field private static final MODE_NONE:I = 0x0

.field private static final MODE_SCALE:I = 0x2


# instance fields
.field private final animationHandler:Landroid/os/Handler;

.field private animationRunnable:Ljava/lang/Runnable;

.field private animationStepCount:I

.field private final animationStepCycle:I

.field private final animationSteps:I

.field private final dragStart:Landroid/graphics/PointF;

.field private final drawableHeight:I

.field private final drawableWidth:I

.field private hasOriginal:Z

.field private final mDistanceThreshold:I

.field private final mDragedListener:Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;

.field private final matrix:Landroid/graphics/Matrix;

.field private mode:I

.field private originalScale:F

.field private originalTranslateX:F

.field private originalTranslateY:F

.field private final savedMatrix:Landroid/graphics/Matrix;

.field private final scaleCenter:Landroid/graphics/PointF;

.field private scaleStart:F

.field private final view:Landroid/widget/ImageView;

.field private final viewHeight:I

.field private final viewWidth:I


# direct methods
.method public constructor <init>(Landroid/widget/ImageView;IIILrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;)V
    .locals 8
    .param p1, "view"    # Landroid/widget/ImageView;
    .param p2, "width"    # I
    .param p3, "height"    # I
    .param p4, "distanceThreshold"    # I
    .param p5, "dragListener"    # Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;

    .prologue
    const/16 v7, 0xa

    const/4 v4, 0x1

    const/high16 v6, 0x40000000    # 2.0f

    const/4 v3, 0x0

    const/4 v5, 0x0

    .line 60
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 21
    iput v3, p0, Lrexsee/dialog/ImageMultiTouchListener;->mode:I

    .line 25
    new-instance v2, Landroid/graphics/Matrix;

    invoke-direct {v2}, Landroid/graphics/Matrix;-><init>()V

    iput-object v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->matrix:Landroid/graphics/Matrix;

    .line 26
    new-instance v2, Landroid/graphics/Matrix;

    invoke-direct {v2}, Landroid/graphics/Matrix;-><init>()V

    iput-object v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->savedMatrix:Landroid/graphics/Matrix;

    .line 27
    new-instance v2, Landroid/graphics/PointF;

    invoke-direct {v2}, Landroid/graphics/PointF;-><init>()V

    iput-object v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->dragStart:Landroid/graphics/PointF;

    .line 28
    new-instance v2, Landroid/graphics/PointF;

    invoke-direct {v2}, Landroid/graphics/PointF;-><init>()V

    iput-object v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->scaleCenter:Landroid/graphics/PointF;

    .line 30
    iput-boolean v3, p0, Lrexsee/dialog/ImageMultiTouchListener;->hasOriginal:Z

    .line 31
    const/high16 v2, 0x3f800000    # 1.0f

    iput v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalScale:F

    .line 32
    iput v5, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalTranslateX:F

    .line 33
    iput v5, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalTranslateY:F

    .line 35
    new-instance v2, Landroid/os/Handler;

    invoke-direct {v2}, Landroid/os/Handler;-><init>()V

    iput-object v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->animationHandler:Landroid/os/Handler;

    .line 37
    iput v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->animationSteps:I

    .line 38
    iput v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->animationStepCycle:I

    .line 39
    iput v3, p0, Lrexsee/dialog/ImageMultiTouchListener;->animationStepCount:I

    .line 61
    iput-object p1, p0, Lrexsee/dialog/ImageMultiTouchListener;->view:Landroid/widget/ImageView;

    .line 62
    iput p4, p0, Lrexsee/dialog/ImageMultiTouchListener;->mDistanceThreshold:I

    .line 63
    iput-object p5, p0, Lrexsee/dialog/ImageMultiTouchListener;->mDragedListener:Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;

    .line 64
    invoke-virtual {p1, v4}, Landroid/widget/ImageView;->setClickable(Z)V

    .line 65
    if-lez p2, :cond_2

    move v2, p2

    :goto_0
    iput v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->viewWidth:I

    .line 66
    if-lez p3, :cond_3

    move v2, p3

    :goto_1
    iput v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->viewHeight:I

    .line 67
    invoke-virtual {p1}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object v0

    .line 68
    .local v0, "drawable":Landroid/graphics/drawable/Drawable;
    if-eqz v0, :cond_0

    instance-of v2, v0, Landroid/graphics/drawable/BitmapDrawable;

    if-nez v2, :cond_4

    .line 69
    :cond_0
    iput v3, p0, Lrexsee/dialog/ImageMultiTouchListener;->drawableWidth:I

    .line 70
    iput v3, p0, Lrexsee/dialog/ImageMultiTouchListener;->drawableHeight:I

    .line 93
    :cond_1
    :goto_2
    return-void

    .line 65
    .end local v0    # "drawable":Landroid/graphics/drawable/Drawable;
    :cond_2
    invoke-virtual {p1}, Landroid/widget/ImageView;->getWidth()I

    move-result v2

    goto :goto_0

    .line 66
    :cond_3
    invoke-virtual {p1}, Landroid/widget/ImageView;->getHeight()I

    move-result v2

    goto :goto_1

    .line 73
    .restart local v0    # "drawable":Landroid/graphics/drawable/Drawable;
    :cond_4
    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I

    move-result v2

    iput v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->drawableWidth:I

    .line 74
    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I

    move-result v2

    iput v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->drawableHeight:I

    .line 75
    invoke-virtual {p1}, Landroid/widget/ImageView;->getScaleType()Landroid/widget/ImageView$ScaleType;

    move-result-object v1

    .line 76
    .local v1, "scaleType":Landroid/widget/ImageView$ScaleType;
    sget-object v2, Landroid/widget/ImageView$ScaleType;->MATRIX:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {p1, v2}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V

    .line 77
    sget-object v2, Landroid/widget/ImageView$ScaleType;->CENTER:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {v1, v2}, Landroid/widget/ImageView$ScaleType;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_1

    .line 78
    sget-object v2, Landroid/widget/ImageView$ScaleType;->CENTER_CROP:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {v1, v2}, Landroid/widget/ImageView$ScaleType;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_1

    .line 79
    sget-object v2, Landroid/widget/ImageView$ScaleType;->CENTER_INSIDE:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {v1, v2}, Landroid/widget/ImageView$ScaleType;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_6

    .line 80
    iput-boolean v4, p0, Lrexsee/dialog/ImageMultiTouchListener;->hasOriginal:Z

    .line 81
    iget v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->viewWidth:I

    int-to-float v2, v2

    iget v3, p0, Lrexsee/dialog/ImageMultiTouchListener;->drawableWidth:I

    int-to-float v3, v3

    div-float/2addr v2, v3

    iget v3, p0, Lrexsee/dialog/ImageMultiTouchListener;->viewHeight:I

    int-to-float v3, v3

    iget v4, p0, Lrexsee/dialog/ImageMultiTouchListener;->drawableHeight:I

    int-to-float v4, v4

    div-float/2addr v3, v4

    invoke-static {v2, v3}, Ljava/lang/Math;->min(FF)F

    move-result v2

    iput v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalScale:F

    .line 82
    iget v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->viewWidth:I

    int-to-float v2, v2

    iget v3, p0, Lrexsee/dialog/ImageMultiTouchListener;->drawableWidth:I

    int-to-float v3, v3

    iget v4, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalScale:F

    mul-float/2addr v3, v4

    sub-float/2addr v2, v3

    div-float/2addr v2, v6

    iput v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalTranslateX:F

    .line 83
    iget v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->viewHeight:I

    int-to-float v2, v2

    iget v3, p0, Lrexsee/dialog/ImageMultiTouchListener;->drawableHeight:I

    int-to-float v3, v3

    iget v4, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalScale:F

    mul-float/2addr v3, v4

    sub-float/2addr v2, v3

    div-float/2addr v2, v6

    iput v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalTranslateY:F

    .line 84
    iget v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalScale:F

    cmpl-float v2, v2, v5

    if-lez v2, :cond_5

    iget-object v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->matrix:Landroid/graphics/Matrix;

    iget v3, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalScale:F

    iget v4, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalScale:F

    invoke-virtual {v2, v3, v4, v5, v5}, Landroid/graphics/Matrix;->postScale(FFFF)Z

    .line 85
    :cond_5
    iget-object v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->matrix:Landroid/graphics/Matrix;

    iget v3, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalTranslateX:F

    iget v4, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalTranslateY:F

    invoke-virtual {v2, v3, v4}, Landroid/graphics/Matrix;->postTranslate(FF)Z

    .line 86
    iget-object v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->matrix:Landroid/graphics/Matrix;

    invoke-virtual {p1, v2}, Landroid/widget/ImageView;->setImageMatrix(Landroid/graphics/Matrix;)V

    goto/16 :goto_2

    .line 87
    :cond_6
    sget-object v2, Landroid/widget/ImageView$ScaleType;->FIT_CENTER:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {v1, v2}, Landroid/widget/ImageView$ScaleType;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_1

    .line 88
    sget-object v2, Landroid/widget/ImageView$ScaleType;->FIT_START:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {v1, v2}, Landroid/widget/ImageView$ScaleType;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_1

    .line 89
    sget-object v2, Landroid/widget/ImageView$ScaleType;->FIT_END:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {v1, v2}, Landroid/widget/ImageView$ScaleType;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_1

    .line 90
    sget-object v2, Landroid/widget/ImageView$ScaleType;->FIT_XY:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {v1, v2}, Landroid/widget/ImageView$ScaleType;->equals(Ljava/lang/Object;)Z

    goto/16 :goto_2
.end method

.method public constructor <init>(Landroid/widget/ImageView;ILrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;)V
    .locals 6
    .param p1, "view"    # Landroid/widget/ImageView;
    .param p2, "distanceThreshold"    # I
    .param p3, "dragListener"    # Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;

    .prologue
    const/4 v2, -0x1

    .line 58
    move-object v0, p0

    move-object v1, p1

    move v3, v2

    move v4, p2

    move-object v5, p3

    invoke-direct/range {v0 .. v5}, Lrexsee/dialog/ImageMultiTouchListener;-><init>(Landroid/widget/ImageView;IIILrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;)V

    .line 59
    return-void
.end method

.method static synthetic access$0(Lrexsee/dialog/ImageMultiTouchListener;)I
    .locals 1

    .prologue
    .line 39
    iget v0, p0, Lrexsee/dialog/ImageMultiTouchListener;->animationStepCount:I

    return v0
.end method

.method static synthetic access$1(Lrexsee/dialog/ImageMultiTouchListener;I)V
    .locals 0

    .prologue
    .line 39
    iput p1, p0, Lrexsee/dialog/ImageMultiTouchListener;->animationStepCount:I

    return-void
.end method

.method static synthetic access$2(Lrexsee/dialog/ImageMultiTouchListener;)Landroid/graphics/Matrix;
    .locals 1

    .prologue
    .line 25
    iget-object v0, p0, Lrexsee/dialog/ImageMultiTouchListener;->matrix:Landroid/graphics/Matrix;

    return-object v0
.end method

.method static synthetic access$3(Lrexsee/dialog/ImageMultiTouchListener;)Landroid/widget/ImageView;
    .locals 1

    .prologue
    .line 24
    iget-object v0, p0, Lrexsee/dialog/ImageMultiTouchListener;->view:Landroid/widget/ImageView;

    return-object v0
.end method

.method static synthetic access$4(Lrexsee/dialog/ImageMultiTouchListener;)Landroid/os/Handler;
    .locals 1

    .prologue
    .line 35
    iget-object v0, p0, Lrexsee/dialog/ImageMultiTouchListener;->animationHandler:Landroid/os/Handler;

    return-object v0
.end method

.method static synthetic access$5(Lrexsee/dialog/ImageMultiTouchListener;)Ljava/lang/Runnable;
    .locals 1

    .prologue
    .line 36
    iget-object v0, p0, Lrexsee/dialog/ImageMultiTouchListener;->animationRunnable:Ljava/lang/Runnable;

    return-object v0
.end method

.method private midPoint(Landroid/graphics/PointF;Landroid/view/MotionEvent;)V
    .locals 7
    .param p1, "point"    # Landroid/graphics/PointF;
    .param p2, "event"    # Landroid/view/MotionEvent;

    .prologue
    const/4 v6, 0x1

    const/4 v5, 0x0

    const/high16 v4, 0x40000000    # 2.0f

    .line 156
    invoke-virtual {p2, v5}, Landroid/view/MotionEvent;->getX(I)F

    move-result v2

    invoke-virtual {p2, v6}, Landroid/view/MotionEvent;->getX(I)F

    move-result v3

    add-float v0, v2, v3

    .line 157
    .local v0, "x":F
    invoke-virtual {p2, v5}, Landroid/view/MotionEvent;->getY(I)F

    move-result v2

    invoke-virtual {p2, v6}, Landroid/view/MotionEvent;->getY(I)F

    move-result v3

    add-float v1, v2, v3

    .line 158
    .local v1, "y":F
    div-float v2, v0, v4

    div-float v3, v1, v4

    invoke-virtual {p1, v2, v3}, Landroid/graphics/PointF;->set(FF)V

    .line 159
    return-void
.end method

.method private spacing(Landroid/view/MotionEvent;)F
    .locals 6
    .param p1, "event"    # Landroid/view/MotionEvent;

    .prologue
    const/4 v5, 0x1

    const/4 v4, 0x0

    .line 150
    invoke-virtual {p1, v4}, Landroid/view/MotionEvent;->getX(I)F

    move-result v2

    invoke-virtual {p1, v5}, Landroid/view/MotionEvent;->getX(I)F

    move-result v3

    sub-float v0, v2, v3

    .line 151
    .local v0, "x":F
    invoke-virtual {p1, v4}, Landroid/view/MotionEvent;->getY(I)F

    move-result v2

    invoke-virtual {p1, v5}, Landroid/view/MotionEvent;->getY(I)F

    move-result v3

    sub-float v1, v2, v3

    .line 152
    .local v1, "y":F
    mul-float v2, v0, v0

    mul-float v3, v1, v1

    add-float/2addr v2, v3

    invoke-static {v2}, Landroid/util/FloatMath;->sqrt(F)F

    move-result v2

    return v2
.end method


# virtual methods
.method public align()V
    .locals 15

    .prologue
    .line 162
    const/16 v11, 0x9

    new-array v9, v11, [F

    .line 163
    .local v9, "values":[F
    iget-object v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->matrix:Landroid/graphics/Matrix;

    invoke-virtual {v11, v9}, Landroid/graphics/Matrix;->getValues([F)V

    .line 164
    const/4 v11, 0x2

    aget v5, v9, v11

    .line 165
    .local v5, "targetTranslateX":F
    const/4 v11, 0x5

    aget v6, v9, v11

    .line 166
    .local v6, "targetTranslateY":F
    iget v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->drawableWidth:I

    int-to-float v11, v11

    const/4 v12, 0x0

    aget v12, v9, v12

    mul-float v10, v11, v12

    .line 167
    .local v10, "width":F
    iget v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->drawableHeight:I

    int-to-float v11, v11

    const/4 v12, 0x4

    aget v12, v9, v12

    mul-float v0, v11, v12

    .line 168
    .local v0, "height":F
    iget v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->viewWidth:I

    int-to-float v11, v11

    cmpl-float v11, v10, v11

    if-lez v11, :cond_3

    .line 169
    const/4 v11, 0x2

    aget v11, v9, v11

    const/4 v12, 0x0

    cmpl-float v11, v11, v12

    if-lez v11, :cond_2

    const/4 v5, 0x0

    .line 177
    :cond_0
    :goto_0
    iget v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->viewHeight:I

    int-to-float v11, v11

    cmpl-float v11, v0, v11

    if-lez v11, :cond_6

    .line 178
    const/4 v11, 0x5

    aget v11, v9, v11

    const/4 v12, 0x0

    cmpl-float v11, v11, v12

    if-lez v11, :cond_5

    const/4 v6, 0x0

    .line 186
    :cond_1
    :goto_1
    const/4 v11, 0x2

    aget v11, v9, v11

    cmpl-float v11, v5, v11

    if-nez v11, :cond_8

    const/4 v11, 0x5

    aget v11, v9, v11

    cmpl-float v11, v6, v11

    if-nez v11, :cond_8

    .line 216
    :goto_2
    return-void

    .line 170
    :cond_2
    const/4 v11, 0x2

    aget v11, v9, v11

    add-float/2addr v11, v10

    iget v12, p0, Lrexsee/dialog/ImageMultiTouchListener;->viewWidth:I

    int-to-float v12, v12

    cmpg-float v11, v11, v12

    if-gez v11, :cond_0

    iget v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->viewWidth:I

    int-to-float v11, v11

    sub-float v5, v11, v10

    goto :goto_0

    .line 172
    :cond_3
    iget v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->viewWidth:I

    int-to-float v11, v11

    sub-float/2addr v11, v10

    const/high16 v12, 0x40000000    # 2.0f

    div-float v1, v11, v12

    .line 173
    .local v1, "midX":F
    const/4 v11, 0x2

    aget v11, v9, v11

    cmpl-float v11, v11, v1

    if-gtz v11, :cond_4

    const/4 v11, 0x2

    aget v11, v9, v11

    add-float/2addr v11, v10

    iget v12, p0, Lrexsee/dialog/ImageMultiTouchListener;->viewWidth:I

    int-to-float v12, v12

    sub-float/2addr v12, v1

    cmpg-float v11, v11, v12

    if-gez v11, :cond_0

    .line 174
    :cond_4
    move v5, v1

    goto :goto_0

    .line 179
    .end local v1    # "midX":F
    :cond_5
    const/4 v11, 0x5

    aget v11, v9, v11

    add-float/2addr v11, v0

    iget v12, p0, Lrexsee/dialog/ImageMultiTouchListener;->viewHeight:I

    int-to-float v12, v12

    cmpg-float v11, v11, v12

    if-gez v11, :cond_1

    iget v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->viewHeight:I

    int-to-float v11, v11

    sub-float v6, v11, v0

    goto :goto_1

    .line 181
    :cond_6
    iget v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->viewHeight:I

    int-to-float v11, v11

    sub-float/2addr v11, v0

    const/high16 v12, 0x40000000    # 2.0f

    div-float v2, v11, v12

    .line 182
    .local v2, "midY":F
    const/4 v11, 0x5

    aget v11, v9, v11

    cmpl-float v11, v11, v2

    if-gtz v11, :cond_7

    const/4 v11, 0x5

    aget v11, v9, v11

    add-float/2addr v11, v0

    iget v12, p0, Lrexsee/dialog/ImageMultiTouchListener;->viewHeight:I

    int-to-float v12, v12

    sub-float/2addr v12, v2

    cmpg-float v11, v11, v12

    if-gez v11, :cond_1

    .line 183
    :cond_7
    move v6, v2

    goto :goto_1

    .line 187
    .end local v2    # "midY":F
    :cond_8
    const/4 v11, 0x2

    aget v11, v9, v11

    sub-float v7, v5, v11

    .line 188
    .local v7, "translateXOffset":F
    const/4 v11, 0x5

    aget v11, v9, v11

    sub-float v8, v6, v11

    .line 189
    .local v8, "translateYOffset":F
    iget v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->mDistanceThreshold:I

    if-lez v11, :cond_c

    iget-object v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->mDragedListener:Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;

    if-eqz v11, :cond_c

    .line 190
    iget v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->mDistanceThreshold:I

    neg-int v11, v11

    int-to-float v11, v11

    cmpg-float v11, v7, v11

    if-gez v11, :cond_9

    iget-object v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->mDragedListener:Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;

    const/4 v12, 0x2

    invoke-virtual {v11, v12}, Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;->dragedOverThreshold(I)V

    .line 191
    :cond_9
    iget v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->mDistanceThreshold:I

    int-to-float v11, v11

    cmpl-float v11, v7, v11

    if-lez v11, :cond_a

    iget-object v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->mDragedListener:Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;

    const/4 v12, 0x3

    invoke-virtual {v11, v12}, Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;->dragedOverThreshold(I)V

    .line 192
    :cond_a
    iget v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->mDistanceThreshold:I

    neg-int v11, v11

    int-to-float v11, v11

    cmpg-float v11, v8, v11

    if-gez v11, :cond_b

    iget-object v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->mDragedListener:Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;

    const/4 v12, 0x0

    invoke-virtual {v11, v12}, Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;->dragedOverThreshold(I)V

    .line 193
    :cond_b
    iget v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->mDistanceThreshold:I

    int-to-float v11, v11

    cmpl-float v11, v8, v11

    if-lez v11, :cond_c

    iget-object v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->mDragedListener:Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;

    const/4 v12, 0x1

    invoke-virtual {v11, v12}, Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;->dragedOverThreshold(I)V

    .line 195
    :cond_c
    const/high16 v11, 0x41200000    # 10.0f

    div-float v3, v7, v11

    .line 196
    .local v3, "stepXOffset":F
    const/high16 v11, 0x41200000    # 10.0f

    div-float v4, v8, v11

    .line 197
    .local v4, "stepYOffset":F
    const/4 v11, 0x0

    iput v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->animationStepCount:I

    .line 198
    new-instance v11, Lrexsee/dialog/ImageMultiTouchListener$1;

    invoke-direct {v11, p0, v3, v4}, Lrexsee/dialog/ImageMultiTouchListener$1;-><init>(Lrexsee/dialog/ImageMultiTouchListener;FF)V

    iput-object v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->animationRunnable:Ljava/lang/Runnable;

    .line 215
    iget-object v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->animationHandler:Landroid/os/Handler;

    iget-object v12, p0, Lrexsee/dialog/ImageMultiTouchListener;->animationRunnable:Ljava/lang/Runnable;

    const-wide/16 v13, 0xa

    invoke-virtual {v11, v12, v13, v14}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    goto/16 :goto_2
.end method

.method public isOriginal()Z
    .locals 5

    .prologue
    const/4 v4, 0x0

    .line 250
    const/16 v2, 0x9

    new-array v1, v2, [F

    .line 251
    .local v1, "values":[F
    iget-object v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->matrix:Landroid/graphics/Matrix;

    invoke-virtual {v2, v1}, Landroid/graphics/Matrix;->getValues([F)V

    .line 252
    iget v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalScale:F

    aget v3, v1, v4

    sub-float v0, v2, v3

    .line 253
    .local v0, "scaleOffset":F
    const/4 v2, 0x0

    cmpl-float v2, v0, v2

    if-ltz v2, :cond_0

    iget v2, p0, Lrexsee/dialog/ImageMultiTouchListener;->mode:I

    const/4 v3, 0x2

    if-eq v2, v3, :cond_0

    const/4 v2, 0x1

    :goto_0
    return v2

    :cond_0
    move v2, v4

    goto :goto_0
.end method

.method public onTouch(Landroid/view/View;Landroid/view/MotionEvent;)Z
    .locals 12
    .param p1, "v"    # Landroid/view/View;
    .param p2, "event"    # Landroid/view/MotionEvent;

    .prologue
    const/4 v9, 0x2

    const/4 v11, 0x1

    const/high16 v8, 0x41200000    # 10.0f

    const/4 v10, 0x0

    .line 98
    instance-of v7, p1, Landroid/widget/ImageView;

    if-nez v7, :cond_0

    move v7, v10

    .line 146
    :goto_0
    return v7

    .line 99
    :cond_0
    move-object v0, p1

    check-cast v0, Landroid/widget/ImageView;

    move-object v6, v0

    .line 101
    .local v6, "view":Landroid/widget/ImageView;
    invoke-virtual {p2}, Landroid/view/MotionEvent;->getAction()I

    move-result v7

    and-int/lit16 v7, v7, 0xff

    packed-switch v7, :pswitch_data_0

    .line 145
    :cond_1
    :goto_1
    :pswitch_0
    iget-object v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->matrix:Landroid/graphics/Matrix;

    invoke-virtual {v6, v7}, Landroid/widget/ImageView;->setImageMatrix(Landroid/graphics/Matrix;)V

    move v7, v10

    .line 146
    goto :goto_0

    .line 103
    :pswitch_1
    iget-object v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->savedMatrix:Landroid/graphics/Matrix;

    iget-object v8, p0, Lrexsee/dialog/ImageMultiTouchListener;->matrix:Landroid/graphics/Matrix;

    invoke-virtual {v7, v8}, Landroid/graphics/Matrix;->set(Landroid/graphics/Matrix;)V

    .line 104
    iget-object v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->dragStart:Landroid/graphics/PointF;

    invoke-virtual {p2}, Landroid/view/MotionEvent;->getX()F

    move-result v8

    invoke-virtual {p2}, Landroid/view/MotionEvent;->getY()F

    move-result v9

    invoke-virtual {v7, v8, v9}, Landroid/graphics/PointF;->set(FF)V

    .line 105
    iput v11, p0, Lrexsee/dialog/ImageMultiTouchListener;->mode:I

    goto :goto_1

    .line 108
    :pswitch_2
    invoke-direct {p0, p2}, Lrexsee/dialog/ImageMultiTouchListener;->spacing(Landroid/view/MotionEvent;)F

    move-result v7

    iput v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->scaleStart:F

    .line 109
    iget v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->scaleStart:F

    cmpl-float v7, v7, v8

    if-lez v7, :cond_1

    .line 110
    iget-object v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->savedMatrix:Landroid/graphics/Matrix;

    iget-object v8, p0, Lrexsee/dialog/ImageMultiTouchListener;->matrix:Landroid/graphics/Matrix;

    invoke-virtual {v7, v8}, Landroid/graphics/Matrix;->set(Landroid/graphics/Matrix;)V

    .line 111
    iget-object v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->scaleCenter:Landroid/graphics/PointF;

    invoke-direct {p0, v7, p2}, Lrexsee/dialog/ImageMultiTouchListener;->midPoint(Landroid/graphics/PointF;Landroid/view/MotionEvent;)V

    .line 112
    iput v9, p0, Lrexsee/dialog/ImageMultiTouchListener;->mode:I

    goto :goto_1

    .line 116
    :pswitch_3
    const/16 v7, 0x9

    new-array v5, v7, [F

    .line 117
    .local v5, "values":[F
    iget-object v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->matrix:Landroid/graphics/Matrix;

    invoke-virtual {v7, v5}, Landroid/graphics/Matrix;->getValues([F)V

    .line 118
    iget-boolean v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->hasOriginal:Z

    if-eqz v7, :cond_2

    .line 119
    aget v7, v5, v10

    iget v8, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalScale:F

    cmpg-float v7, v7, v8

    if-gez v7, :cond_3

    .line 120
    invoke-virtual {p0}, Lrexsee/dialog/ImageMultiTouchListener;->restore()V

    .line 126
    .end local v5    # "values":[F
    :cond_2
    :goto_2
    :pswitch_4
    iput v10, p0, Lrexsee/dialog/ImageMultiTouchListener;->mode:I

    goto :goto_1

    .line 122
    .restart local v5    # "values":[F
    :cond_3
    invoke-virtual {p0}, Lrexsee/dialog/ImageMultiTouchListener;->align()V

    goto :goto_2

    .line 129
    .end local v5    # "values":[F
    :pswitch_5
    iget v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->mode:I

    if-ne v7, v11, :cond_4

    .line 130
    iget-object v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->matrix:Landroid/graphics/Matrix;

    iget-object v8, p0, Lrexsee/dialog/ImageMultiTouchListener;->savedMatrix:Landroid/graphics/Matrix;

    invoke-virtual {v7, v8}, Landroid/graphics/Matrix;->set(Landroid/graphics/Matrix;)V

    .line 131
    invoke-virtual {p2}, Landroid/view/MotionEvent;->getX()F

    move-result v7

    iget-object v8, p0, Lrexsee/dialog/ImageMultiTouchListener;->dragStart:Landroid/graphics/PointF;

    iget v8, v8, Landroid/graphics/PointF;->x:F

    sub-float v3, v7, v8

    .line 132
    .local v3, "tx":F
    invoke-virtual {p2}, Landroid/view/MotionEvent;->getY()F

    move-result v7

    iget-object v8, p0, Lrexsee/dialog/ImageMultiTouchListener;->dragStart:Landroid/graphics/PointF;

    iget v8, v8, Landroid/graphics/PointF;->y:F

    sub-float v4, v7, v8

    .line 133
    .local v4, "ty":F
    iget-object v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->matrix:Landroid/graphics/Matrix;

    invoke-virtual {v7, v3, v4}, Landroid/graphics/Matrix;->postTranslate(FF)Z

    goto :goto_1

    .line 134
    .end local v3    # "tx":F
    .end local v4    # "ty":F
    :cond_4
    iget v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->mode:I

    if-ne v7, v9, :cond_1

    .line 135
    invoke-direct {p0, p2}, Lrexsee/dialog/ImageMultiTouchListener;->spacing(Landroid/view/MotionEvent;)F

    move-result v1

    .line 136
    .local v1, "newDist":F
    cmpl-float v7, v1, v8

    if-lez v7, :cond_1

    .line 137
    iget-object v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->matrix:Landroid/graphics/Matrix;

    iget-object v8, p0, Lrexsee/dialog/ImageMultiTouchListener;->savedMatrix:Landroid/graphics/Matrix;

    invoke-virtual {v7, v8}, Landroid/graphics/Matrix;->set(Landroid/graphics/Matrix;)V

    .line 138
    iget v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->scaleStart:F

    div-float v2, v1, v7

    .line 139
    .local v2, "scale":F
    iget-object v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->matrix:Landroid/graphics/Matrix;

    iget-object v8, p0, Lrexsee/dialog/ImageMultiTouchListener;->scaleCenter:Landroid/graphics/PointF;

    iget v8, v8, Landroid/graphics/PointF;->x:F

    iget-object v9, p0, Lrexsee/dialog/ImageMultiTouchListener;->scaleCenter:Landroid/graphics/PointF;

    iget v9, v9, Landroid/graphics/PointF;->y:F

    invoke-virtual {v7, v2, v2, v8, v9}, Landroid/graphics/Matrix;->postScale(FFFF)Z

    goto/16 :goto_1

    .line 101
    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_1
        :pswitch_3
        :pswitch_5
        :pswitch_0
        :pswitch_0
        :pswitch_2
        :pswitch_4
    .end packed-switch
.end method

.method public restore()V
    .locals 8

    .prologue
    const/4 v7, 0x0

    const/high16 v6, 0x41200000    # 10.0f

    .line 218
    const/16 v0, 0x9

    new-array v2, v0, [F

    .line 219
    .local v2, "values":[F
    iget-object v0, p0, Lrexsee/dialog/ImageMultiTouchListener;->matrix:Landroid/graphics/Matrix;

    invoke-virtual {v0, v2}, Landroid/graphics/Matrix;->getValues([F)V

    .line 220
    iget v0, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalScale:F

    aget v1, v2, v7

    sub-float/2addr v0, v1

    div-float v3, v0, v6

    .line 221
    .local v3, "scaleOffset":F
    iget v0, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalTranslateX:F

    const/4 v1, 0x2

    aget v1, v2, v1

    sub-float/2addr v0, v1

    div-float v4, v0, v6

    .line 222
    .local v4, "translateXOffset":F
    iget v0, p0, Lrexsee/dialog/ImageMultiTouchListener;->originalTranslateY:F

    const/4 v1, 0x5

    aget v1, v2, v1

    sub-float/2addr v0, v1

    div-float v5, v0, v6

    .line 223
    .local v5, "translateYOffset":F
    iput v7, p0, Lrexsee/dialog/ImageMultiTouchListener;->animationStepCount:I

    .line 224
    new-instance v0, Lrexsee/dialog/ImageMultiTouchListener$2;

    move-object v1, p0

    invoke-direct/range {v0 .. v5}, Lrexsee/dialog/ImageMultiTouchListener$2;-><init>(Lrexsee/dialog/ImageMultiTouchListener;[FFFF)V

    iput-object v0, p0, Lrexsee/dialog/ImageMultiTouchListener;->animationRunnable:Ljava/lang/Runnable;

    .line 246
    iget-object v0, p0, Lrexsee/dialog/ImageMultiTouchListener;->animationHandler:Landroid/os/Handler;

    iget-object v1, p0, Lrexsee/dialog/ImageMultiTouchListener;->animationRunnable:Ljava/lang/Runnable;

    const-wide/16 v6, 0xa

    invoke-virtual {v0, v1, v6, v7}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    .line 247
    return-void
.end method
